<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Data Structures for Sets and Graphs: DirectlyAddressedSet::Iterator Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Data Structures for Sets and Graphs
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Macros</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="classDirectlyAddressedSet.html">DirectlyAddressedSet</a></li><li class="navelem"><a class="el" href="classDirectlyAddressedSet_1_1Iterator.html">Iterator</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">DirectlyAddressedSet::Iterator Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>A general iterator to scan a <a class="el" href="classDirectlyAddressedSet.html" title="A static or dynamic set of elements with direct addressing.">DirectlyAddressedSet</a>.  
 <a href="classDirectlyAddressedSet_1_1Iterator.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="DirectlyAddressedSet_8h_source.html">DirectlyAddressedSet.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for DirectlyAddressedSet::Iterator:</div>
<div class="dyncontent">
<div class="center"><img src="classDirectlyAddressedSet_1_1Iterator__inherit__graph.png" border="0" usemap="#DirectlyAddressedSet_1_1Iterator_inherit__map" alt="Inheritance graph"/></div>
<map name="DirectlyAddressedSet_1_1Iterator_inherit__map" id="DirectlyAddressedSet_1_1Iterator_inherit__map">
<area shape="rect" id="node3" href="classBitMapDirectlyAddressedSet_1_1BitMapIterator.html" title="An abstract implementation of DirectlyAddressedSet::Iterator." alt="" coords="204,39,393,86"/><area shape="rect" id="node9" href="classMultiLevelDirectlyAddressedSet_1_1MultiIterator.html" title="A generic iterator on the set of elements." alt="" coords="205,109,392,155"/><area shape="rect" id="node5" href="classBitMapDirectlyAddressedSet_1_1ComplIterator.html" title="BitMapDirectlyAddressedSet\l\&lt; T \&gt;::ComplIterator" alt="" coords="444,5,633,51"/><area shape="rect" id="node7" href="classBitMapDirectlyAddressedSet_1_1FilteredBitMapIterator.html" title="BitMapDirectlyAddressedSet\l\&lt; T \&gt;::FilteredBitMapIterator" alt="" coords="444,74,633,121"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="classDirectlyAddressedSet_1_1Iterator-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aed6d9cffc7ce084fc3a4607ac9e7658d"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDirectlyAddressedSet_1_1Iterator.html#aed6d9cffc7ce084fc3a4607ac9e7658d">~Iterator</a> ()</td></tr>
<tr class="memdesc:aed6d9cffc7ce084fc3a4607ac9e7658d"><td class="mdescLeft">&#160;</td><td class="mdescRight">The destructor.  <a href="#aed6d9cffc7ce084fc3a4607ac9e7658d"></a><br/></td></tr>
<tr class="memitem:ae4eb65beabbaa126db89529f3d3e2f3a"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDirectlyAddressedSet_1_1Iterator.html#ae4eb65beabbaa126db89529f3d3e2f3a">restart</a> ()</td></tr>
<tr class="memdesc:ae4eb65beabbaa126db89529f3d3e2f3a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Restarts the enumeration.  <a href="#ae4eb65beabbaa126db89529f3d3e2f3a"></a><br/></td></tr>
<tr class="memitem:a1421c0a751aafa1de9cd0bed72bd2bdd"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDirectlyAddressedSet_1_1Iterator.html#a1421c0a751aafa1de9cd0bed72bd2bdd">restartFrom</a> (long from)=0</td></tr>
<tr class="memdesc:a1421c0a751aafa1de9cd0bed72bd2bdd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Restarts the enumeration from a specified value (which is not required to be a key in the universe).  <a href="#a1421c0a751aafa1de9cd0bed72bd2bdd"></a><br/></td></tr>
<tr class="memitem:ab3ef5a45f421b1f1b2875e60977aafc7"><td class="memItemLeft" align="right" valign="top">virtual long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDirectlyAddressedSet_1_1Iterator.html#ab3ef5a45f421b1f1b2875e60977aafc7">next</a> ()=0</td></tr>
<tr class="memdesc:ab3ef5a45f421b1f1b2875e60977aafc7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enumerates the first key in the set next to the current cursor position.  <a href="#ab3ef5a45f421b1f1b2875e60977aafc7"></a><br/></td></tr>
<tr class="memitem:aec520a3f6d74fabb6d378051b070a22b"><td class="memItemLeft" align="right" valign="top">virtual long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDirectlyAddressedSet_1_1Iterator.html#aec520a3f6d74fabb6d378051b070a22b">nextUpTo</a> (long to)=0</td></tr>
<tr class="memdesc:aec520a3f6d74fabb6d378051b070a22b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enumerates the first key in the set next to the current cursor position up to a specified value.  <a href="#aec520a3f6d74fabb6d378051b070a22b"></a><br/></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:acc93f949a845d47f30ee6f6c75334577"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDirectlyAddressedSet_1_1Iterator.html#acc93f949a845d47f30ee6f6c75334577">Iterator</a> ()</td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>A general iterator to scan a <a class="el" href="classDirectlyAddressedSet.html" title="A static or dynamic set of elements with direct addressing.">DirectlyAddressedSet</a>. </p>
<p>It scans each key in a set, allowing the programmer to traverse the set in either ascending or descending order. An object of this class has no current key; its cursor position always lies before the key that would be returned by a call to <a class="el" href="classDirectlyAddressedSet_1_1Iterator.html#ab3ef5a45f421b1f1b2875e60977aafc7" title="Enumerates the first key in the set next to the current cursor position.">next()</a>. An iterator for a set of size <img class="formulaInl" alt="$n$" src="form_22.png"/> has <img class="formulaInl" alt="$n+1$" src="form_23.png"/> possible cursor positions, as illustrated by the indices below: </p>
<pre class="fragment">                     Element(0)   Element(1)   Element(2)   ... Element(n-1)
cursor positions:  0            1            2           ...                  n
</pre><p>An object of this class is backed by the corresponding set.</p>
<p>An object of this class keeps the state of an enumeration. This means that various enumerations can be performed simultaneously provided that each of them is associated with a different iterator. However, an error may occur in a method of this class if the set is modified during the enumeration. </p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="acc93f949a845d47f30ee6f6c75334577"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">DirectlyAddressedSet::Iterator::Iterator </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="aed6d9cffc7ce084fc3a4607ac9e7658d"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual DirectlyAddressedSet::Iterator::~Iterator </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>The destructor. </p>
<p>A simple destructor. </p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ab3ef5a45f421b1f1b2875e60977aafc7"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual long DirectlyAddressedSet::Iterator::next </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Enumerates the first key in the set next to the current cursor position. </p>
<p>This method may be called repeatedly to traverse the set in ascending order.</p>
<p>An arbitrary value outside the universe is returned if there is no next key in the current set.</p>
<dl class="section return"><dt>Returns:</dt><dd>the next element to be enumerated, if there is one, or a value greater than all values in the universe otherwise </dd></dl>

<p>Implemented in <a class="el" href="classBitMapDirectlyAddressedSet_1_1BitMapIterator.html#ac020243089a5555e40cc7f8457405c5e">BitMapDirectlyAddressedSet&lt; T &gt;::BitMapIterator</a>, and <a class="el" href="classMultiLevelDirectlyAddressedSet_1_1MultiIterator.html#a55915209b819c78735f38761be61c6ca">MultiLevelDirectlyAddressedSet&lt; T &gt;::MultiIterator</a>.</p>

</div>
</div>
<a class="anchor" id="aec520a3f6d74fabb6d378051b070a22b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual long DirectlyAddressedSet::Iterator::nextUpTo </td>
          <td>(</td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>to</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Enumerates the first key in the set next to the current cursor position up to a specified value. </p>
<p>This method may be called repeatedly to traverse the set in ascending order. In special, this method is useful to enumerate a particular node of a level of a tree of bitmaps.</p>
<p>This method differs from <a class="el" href="classDirectlyAddressedSet_1_1Iterator.html#ab3ef5a45f421b1f1b2875e60977aafc7" title="Enumerates the first key in the set next to the current cursor position.">next()</a> in the sense it stops searching for the next key when the specified limit is reached. If there is no next key in the current set up to the specified value, then the new cursor position is unpredictable and an arbitrary value greater than or equal to the specified range is returned. In this case, a call to <a class="el" href="classDirectlyAddressedSet_1_1Iterator.html#ae4eb65beabbaa126db89529f3d3e2f3a" title="Restarts the enumeration.">restart()</a> or <a class="el" href="classDirectlyAddressedSet_1_1Iterator.html#a1421c0a751aafa1de9cd0bed72bd2bdd" title="Restarts the enumeration from a specified value (which is not required to be a key in the universe)...">restartFrom(long)</a> must be performed before any call to enumeration methods.</p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">to</td><td>the value to limit the enumeration</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>the next key to be enumerated up to the specified value, if there is one, or a value greater than or equal to the specified value otherwise </dd></dl>

<p>Implemented in <a class="el" href="classBitMapDirectlyAddressedSet_1_1ComplIterator.html#ac5b6acf44ba8694204286383bbdcd6a3">BitMapDirectlyAddressedSet&lt; T &gt;::ComplIterator</a>, <a class="el" href="classBitMapDirectlyAddressedSet_1_1FilteredBitMapIterator.html#ac1c14fba56789e4e228f14cbf87fe144">BitMapDirectlyAddressedSet&lt; T &gt;::FilteredBitMapIterator</a>, <a class="el" href="classBitMapDirectlyAddressedSet_1_1BitMapIterator.html#a32961844f00ab60edb5b3a2caf3ac9a5">BitMapDirectlyAddressedSet&lt; T &gt;::BitMapIterator</a>, and <a class="el" href="classMultiLevelDirectlyAddressedSet_1_1MultiIterator.html#aa692987322ed31614c52c43711011d9f">MultiLevelDirectlyAddressedSet&lt; T &gt;::MultiIterator</a>.</p>

</div>
</div>
<a class="anchor" id="ae4eb65beabbaa126db89529f3d3e2f3a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void DirectlyAddressedSet::Iterator::restart </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Restarts the enumeration. </p>
<p>The current state of the object will be lost and the cursor is reset to a position such that a call to <a class="el" href="classDirectlyAddressedSet_1_1Iterator.html#ab3ef5a45f421b1f1b2875e60977aafc7" title="Enumerates the first key in the set next to the current cursor position.">next()</a> returns the first key in the set. In special, the enumeration must be restarted when <a class="el" href="classDirectlyAddressedSet_1_1Iterator.html#aec520a3f6d74fabb6d378051b070a22b" title="Enumerates the first key in the set next to the current cursor position up to a specified value...">nextUpTo()</a> fails.</p>
<p>It is implemented in this class as restartFrom(0). </p>

</div>
</div>
<a class="anchor" id="a1421c0a751aafa1de9cd0bed72bd2bdd"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void DirectlyAddressedSet::Iterator::restartFrom </td>
          <td>(</td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>from</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Restarts the enumeration from a specified value (which is not required to be a key in the universe). </p>
<p>The current state of the object will be lost and the cursor is reset to the position such that a call to <a class="el" href="classDirectlyAddressedSet_1_1Iterator.html#ab3ef5a45f421b1f1b2875e60977aafc7" title="Enumerates the first key in the set next to the current cursor position.">next()</a> returns the smallest key greater than or equal to the specified value. In special, the enumeration must be restarted when <a class="el" href="classDirectlyAddressedSet_1_1Iterator.html#aec520a3f6d74fabb6d378051b070a22b" title="Enumerates the first key in the set next to the current cursor position up to a specified value...">nextUpTo()</a> fails.</p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">from</td><td>the specified value </td></tr>
  </table>
  </dd>
</dl>

<p>Implemented in <a class="el" href="classBitMapDirectlyAddressedSet_1_1ComplIterator.html#a8410806452c612472d23fdc7ca1ed5a6">BitMapDirectlyAddressedSet&lt; T &gt;::ComplIterator</a>, <a class="el" href="classBitMapDirectlyAddressedSet_1_1FilteredBitMapIterator.html#a13d46e202098ded96d1de860520088ec">BitMapDirectlyAddressedSet&lt; T &gt;::FilteredBitMapIterator</a>, <a class="el" href="classBitMapDirectlyAddressedSet_1_1BitMapIterator.html#a70f25a8f961d2beffe72c019f6c74f55">BitMapDirectlyAddressedSet&lt; T &gt;::BitMapIterator</a>, and <a class="el" href="classMultiLevelDirectlyAddressedSet_1_1MultiIterator.html#ad3cd5226fa6f397a1bbe323fd4603851">MultiLevelDirectlyAddressedSet&lt; T &gt;::MultiIterator</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>datastruct/<a class="el" href="DirectlyAddressedSet_8h_source.html">DirectlyAddressedSet.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Nov 26 2012 17:06:46 for Data Structures for Sets and Graphs by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.1.1
</small></address>
</body>
</html>
